package cn.singno.springBoot.demo.ch16_mvc;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rest2")
public class DemoRestController2 {

	@RequestMapping(value="/user" , produces={"application/json;charset=UTF-8","application/xml;charset=UTF-8"})
	public Object user(HttpServletRequest request){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("name", "singno");
		map.put("age", 18);
		return map;
	}
}
